﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Web.Script.Serialization;
using System.Text;
using CLEX.ServiceContracts;
using CLEX.DataContracts;
using CLEX.Server.DAL;


namespace CLEX.Server.Host
{
    public class ClientService : IClientService
    {
       

        public bool Login(string username, string password)
        {

            
           
            bool result = false;
            if (username.Equals(password))
            {
                result = true;
            }
            return result;
            
        }

        public List<DatabaseData> GetDatabaseByOwner(string username)
        {
            return new List<DatabaseData>()
            {
                new DatabaseData()
                {
                    ConnectionString = "This is a fake connections string.",
                    DatabaseId = 1,
                    Name = "Some Cool Name!!!",
                    OwnerUserId = 100,
                },
                new DatabaseData()
                {
                    ConnectionString = "This is the fake connections tring.",
                    DatabaseId = 2,
                    Name = "Some Cool Name for the second databse!!!",
                    OwnerUserId = 1010,
                }
            };
        }

        public List<DatabaseData> GetDatabasesSharedWith(string username)
        {
            return new List<DatabaseData>()
            {
                new DatabaseData()
                {
                    ConnectionString = "JFJFJFThis is a fake connections string.",
                    DatabaseId = 1,
                    Name = "JFJFJFSome Cool Name!!!",
                    OwnerUserId = 100,
                },
                new DatabaseData()
                {
                    ConnectionString = "JFJFJFThis is the fake connections tring.",
                    DatabaseId = 2,
                    Name = "JFJFJFSome Cool Name for the second databse!!!",
                    OwnerUserId = 1010,
                }
            };
        }

        public void ShareDatabase(int[] databaseId, int userId)
        {

        }
    }
}
